package com.infindo.iflower;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.Button;

public class AboutUs extends Activity {

	private Button galleryBtn;
	private Button favoriteBtn;
	private Button aboutusBtn;
	private Button visit;
	
	public AboutUs() {
		// TODO Auto-generated constructor stub
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.aboutus);
		
		findView();
	}
	
	private void findView(){
		visit = (Button)findViewById(R.id.baboutus);
		visit.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Uri uri = Uri.parse("http://www.infindo.com");   
				Intent intent = new Intent(Intent.ACTION_VIEW,uri);
				startActivity(intent);
				finish();
			}
			
		});
		galleryBtn = (Button)findViewById(R.id.gallerybtn);
		galleryBtn.setOnTouchListener(touchLisenter);
		favoriteBtn = (Button)findViewById(R.id.favoritebtn);
		favoriteBtn.setOnTouchListener(touchLisenter);
		aboutusBtn = (Button)findViewById(R.id.aboutus);
		aboutusBtn.setOnTouchListener(touchLisenter);
		
		galleryBtn.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(AboutUs.this, GridGallery.class);
				startActivity(intent);
				finish();
			}
		});
		favoriteBtn.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(AboutUs.this, GridFavorite.class);
				startActivity(intent);
				finish();
			}
		});
		aboutusBtn.setBackgroundColor(Color.GRAY);
	}
	
	private OnTouchListener touchLisenter = new OnTouchListener(){   
        @Override  
        public boolean onTouch(View v, MotionEvent event) {

            if(event.getAction() == MotionEvent.ACTION_DOWN){
                v.setBackgroundColor(Color.parseColor("#BDBDBD"));
            }   
            else if(event.getAction() == MotionEvent.ACTION_UP){   
                //v.setBackgroundResource(R.drawable.play);   
            	v.setBackgroundColor(Color.parseColor("#848484"));
            }   

            return false;   
        }   
           
    }; 
	
}
